<html><body>

<?php 

echo "Connecting ...<br />";

// Make a MySQL Connection
mysql_connect("localhost", "kindle", "furrball") or die(mysql_error());
mysql_select_db("kindle") or die(mysql_error());

echo "Deleting old entries ...<br />";
// Retrieve all the data from the "example" table
$result = mysql_query("DELETE FROM rss_sources where user_id=1")
or die(mysql_error());  

$img= $_GET['img'];
$count = count($img);
echo "count: $count <br>";
for($i=0; $i < $count; $i++)
{
	$url=trim($img[$i]);
	if ($url=="")
	{
		echo "Skipping empty entry ...<br />";
	}
	else 
	{
		echo "Inserting ".$url."...<br />";
		$result = mysql_query("INSERT rss_sources (user_id, url, verified) values (1, '".$url."', 1)")
		or die(mysql_error()); 
	}
}?>

</body></html>